<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>两种导航方式</title>
  <style>
    body {
      font-family:Arial, Helvetica, sans-serif;
    }
    /* 设置横向导航 */
    .navbar {
      list-style: none;
      margin: 0px;
      padding: 0px;
      background: #4c6ca0;
      border-radius: 5px;

      /* 解决float背景显示异常 */
      overflow: auto;
    }

    .navbar li a {
      display: block;
      color: #fff;
      text-decoration: none;
      padding: 15px 20px;
    }

    .navbar li {
      /* float是忽视边距，直接浮动拼接内容长度 */
      float: left;
    }

    .navbar li a:hover {
      background: #446190;
      color: red;
    }

    /* 设置侧边导航 */
    .side-menu {
      list-style: none;
      border: 1p #ddd solid;
      border-radius: 10px;
      width: 300px;
      padding: 20px;
    }

    .side-menu li {
      font-size: 18px;
      line-height: 2.4em;
      border-bottom: dotted 1px #ddd;
     
    }
    
    .side-menu li a {
      color: #333;
      text-decoration: none;
    }

    /* last-childe选中最后一个 */
    .side-menu li:last-child {
      border: none;
    }

    .side-menu li a:hover {
      color: coral;
    }
  </style>
</head>
<body>
  <!-- 侧边导航 -->
  <!-- ul>li*4>a -->
  <ul class="side-menu">
    <li><a href="#">主页</a></li>
    <li><a href="#">关于我们</a></li>
    <li><a href="#">服务</a></li>
    <li><a href="#">联系我们</a></li>
  </ul>

  <!-- 横向导航 -->
  <ul class="navbar">
    <li><a href="">主页</a></li>
    <li><a href="">关于我们</a></li>
    <li><a href="">服务</a></li>
    <li><a href="">联系我们</a></li>
  </ul>
</body>
</html>